<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/utils.js"></script> 
<script src="/wondershare/js/topic.js"></script> 
<script src="/wondershare/js/jquery.hotkeys.js"></script> 
<script src="/wondershare/js/jquery.cvbox.min.js"></script> 
<script src="../../fckeditor/fckeditor.js"></script> 

<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<title>文章<{$tile}>页</title>
<style type="text/css">
catListTag {
	DISPLAY: none
}
.cvBoxShade {
	Z-INDEX: 2000; BACKGROUND: #ccc; LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 0px; HEIGHT: 0px
}
.cvBoxBorder {
	BORDER-RIGHT: #000000 0px solid; PADDING-RIGHT: 8px; BORDER-TOP: #000000 0px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; Z-INDEX: 2000; PADDING-BOTTOM: 8px; BORDER-LEFT: #000000 0px solid; WIDTH: 100%; PADDING-TOP: 8px; BORDER-BOTTOM: #000000 0px solid; POSITION: absolute; BACKGROUND-COLOR: #ccc
}
.cvBoxBorder A {
	COLOR: #486aaa; TEXT-DECORATION: none
}
.cvBoxBorder A:hover {
	COLOR: #c00; TEXT-DECORATION: none
}
.cvBoxTitleBar {
	WIDTH: 100%; LINE-HEIGHT: 27px; HEIGHT: 26px; BACKGROUND-COLOR: #eeeeee
}
.cvBoxTitleBarText {
	PADDING-LEFT: 10px; FONT-WEIGHT: bold; FLOAT: left; COLOR: #333
}
.cvBoxTitleBarClose {
	PADDING-RIGHT: 10px; FLOAT: right; COLOR: #3867af; FONT-FAMILY: Verdana
}

.cvBoxBody {
	WIDTH: 100%; BACKGROUND-COLOR: #ffffff
}

</style>
<script type="text/javascript">
<{if $form_act == 'add'}>
$(document).ready(function(){
   get_article(<{$w_type}>);
 }); 
 <{/if}>
  
  function  get_article(w_type)
  {
 
    $.get("/wondershare/article.php?action=index", { checkbox: 'checkbox',parent_id:$('#parent_id').val(),act:'<{$form_act}>',related_article:$("#hi_related_article").val(),
	ar_id:$('#ar_id').val(),w_type:w_type},
    function(data){

     $("#get_article").html(data);
   },'html');
  }
    function create(){
        var oFCKeditor          = new FCKeditor('ar_content');      //创建FCK对象
        oFCKeditor.Height      = 800;        //设置FCK显示高度
        oFCKeditor.Width      = 850;        //设置FCK显示宽度
        oFCKeditor.BasePath   = "../../fckeditor/";    //指定编辑器路径，要加载fckeditor/editor/fckeditor.html
        oFCKeditor.ReplaceTextarea();   
    }
	
	
	function  show(id_table)
	{
	  if(id_table == 'general-table')
	  {
	   $("#"+id_table).show();
	   $("#detail-table").hide();
	   $("#general-tab").addClass('tab-front');
	   $("#detail-tab").addClass('tab-back');
	   
	   $("#detail-tab").removeClass("tab-front"); 
	   $("#general-tab").removeClass("tab-back"); 
	  }else if(id_table == 'detail-table')
	  {
	   $("#"+id_table).show();
	   $("#general-table").hide();
	   $("#general-tab").addClass('tab-back');
	   $("#detail-tab").addClass('tab-front');
	   
	   $("#detail-tab").removeClass("tab-back"); 
	   $("#general-tab").removeClass("tab-front");
	  }
	}
	function  addOtherCat()
	{
	
	 var sel = document.createElement("SELECT");
     var selCat = document.forms['theForm'].elements['type_id'];

      for (i = 0; i < selCat.length; i++)
      {
          var opt = document.createElement("OPTION");
          opt.text = selCat.options[i].text;
          opt.value = selCat.options[i].value;
	
          if (Browser.isIE)
          {
              sel.add(opt);
          }
          else
          {
              sel.appendChild(opt);
          }
      }

      sel.name = "other_cat[]";

	 $('#addOther_type').append(sel);
	}
	

function select_checked(check_name,input_name,hide_name,div_Demo)
{
  var str = "";
  $('input[name="'+check_name+'[]"]').each(function () {
  if ($(this).attr('checked')) 
  {
     str += $(this).val() + ",";
   }
  });
  $("#"+input_name).val(str);
  $("#"+hide_name).val(str);
  $("#cvBoxTitleBarClose").click();
  $("#"+div_Demo).hide();

   $("#parent_id").show();
   $("#is_recommend").show();
   $("#is_hot").show();

}

var ajax_ar_id = 0;

function check_submit(ar_id,w_type, ajax_save)//note 当ajax_save = 1为Ctrl+s保存数据时检查表单
{
	ar_id = Math.max( ajax_ar_id, ar_id);
	var checkContent = FCKeditorAPI.GetInstance("ar_content").GetXHTML();
  if($('#ar_title').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('文章标题不能为空！');
	  secend = 60;
      $("#ar_title").focus();
      return false;
  }else if(checkContent.replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('文章正文不能为空！');
	  secend = 60;
      $("#ar_content").focus();
      return false;
  }
  
  $.get("/wondershare/article.php?action=index", { jax_type: 'repeat_article', ar_title: $('#ar_title').val(),type:'select',ar_id:parseInt(ar_id),w_type:w_type},
  function(data){//alert(data)
  if(data > 0)
  {
	alert('文章标题不能重复！');
	secend = 60;
    $("#ar_title").focus();
     return false;
   }else{
		if( ajax_save == 1 ) save();
    	else $("#theForm").submit();
   }
  });
  
  
  
  
}

function textCounter(maxlimit) 
{

  var introduction = $("#ar_introduction").val();
  if (introduction.length > maxlimit) 
  {
   $("#ar_introduction").val(introduction.substring(0,maxlimit)) ;
  }

}

//note Ctrl+s保存
$.hotkeys.add('Ctrl+s', function(){
	saveCheck();
});

//note Ctrl+1保存
$.hotkeys.add('Ctrl+1', function(){
	saveCheck();
});
//note Ctrl+2保存
$.hotkeys.add('Ctrl+2', function(){
	saveCheck();
});
//note Ctrl+3保存
$.hotkeys.add('Ctrl+3', function(){
	saveCheck();
});
//note Ctrl+4保存
$.hotkeys.add('Ctrl+4', function(){
	saveCheck();
});

//note Ctrl+5保存
$.hotkeys.add('Ctrl+5', function(){
	saveCheck();
});

//note Alt+s保存
$.hotkeys.add('Alt+s', function(){
	saveCheck();
});

//note
function saveCheck(){
	//表单检查
	var ret = check_submit(<{if $article_info.ar_id >0 }><{$article_info.ar_id}><{else}>0<{/if}>,<{$w_type}>, 1);
}

//note Ctrl+s保存数据
function save(){
	var date = new Date();
	return false;
	var obj = {
		"ar_title":			$("#ar_title").val(),
		"ar_subtitle":		$("#ar_subtitle").val(),
		"ar_image":			$("#ar_image").val(),
		"parent_id":		$("#parent_id").val(),
		"other_cat_id":		$("#other_cat_id").val(),
		"ar_tag_id":		$("#ar_tag_id").val(),
		"hi_related_article":$("#hi_related_article").val(),
		"hi_product_related":$("#hi_product_related").val(),
		"is_recommend":		$("#is_recommend").val(),
		"is_hot":			$("#is_hot").val(),
		"click_count":		$("#click_count").val(),
		"author_id":		$("#author_id").val(),
		"ar_introduction":	$("#ar_introduction").val(),
		"ar_content":		 FCKeditorAPI.GetInstance("ar_content").GetXHTML(),
		"ar_id":			$("#ar_id").val(),
		"image_file":		$("#image_file").val(),
		"related_pro_bottom":$("#related_pro_bottom").val(),
		"act":				$("#act").val(),
		"save_by_ajax":		1
	}
	
	$.post('/wondershare/article.php?action=index&w_type=<{$w_type}>',obj,function(data){//alert(data);
		data = data.split(":");
		var state = data[0];
		var ar_id = data[1] ? data[1] : 0;//有值时表示是添加
		if( state == 'ok' ){
			var date = new Date();
			$("#save_time").html(date.getHours()+"时"+date.getMinutes()+"分"+date.getSeconds()+"秒 成功保存数据");
			secend = 60;
			if( ar_id ){//添加状态保存成功后改为编辑状态
				$("#ar_id").val( ar_id );
				$("#act").val('edit');
				ajax_ar_id = ar_id;
			}
		}else{
			$("#save_time").html("保存失败");
		}
	});		
}

//note 每隔一分钟将自动保存
var secend = 60;
setInterval(function(){
	//if( $("#act").val() == 'edit' ){
		$("#after_save_time").html( secend-- );
		if( secend <= 0 ){
			secend = 0;
			saveCheck();
		}
	//}	
},1000);
</script>
</head>

<body  onload="create();">

<h1>
<span class="action-span">
<a href="/wondershare/article.php?action=index&w_type=<{$w_type}>">文章列表</a>
</span>
<span class="action-span1">
<{if $w_type == 1}>
<a href="/wondershare/products.php?action=index">WS.COM网站产品信息</a>  > 
<{/if}>
<a href="/wondershare/article.php?action=index&w_type=<{$w_type}>"><{$web_info}>网站文章信息</a> >
</span>
<span id="search_id" class="action-span1">  文章<{$tile}> </span>
<div style="clear:both"></div>
</h1>

<div id="tabbar-div">
      <p>
        <span id="general-tab" class="tab-front" onclick="show('general-table')">通用信息</span><span id="detail-tab" class="tab-back" onclick="show('detail-table')">详细描述</span><span style="color:#fff;"><span id="save_time" style="margin-left:200px;color:#fff;">Ctrl+S 或 Alt+S 或 Ctrl+1至5 可立即保存</span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="after_save_time">60</span> 秒后将自动保存</span>
      </p>
    </div>
<div id="tabbody-div"  style=" width:1100px;">
      <form  name="theForm" method="post"  id="theForm" action="/wondershare/article.php?action=index&w_type=<{$w_type}>" enctype="multipart/form-data">
        <!-- 最大文件限制 -->
        <input type="hidden" value="2097152" name="MAX_FILE_SIZE">
        <!-- 通用信息 -->
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <tr>
            <td class="label">文章标题：</td>
            <td><input type="text" size="30" style="float:left;width:350px;;" value="<{$article_info.ar_title|escape}>" name="ar_title" id="ar_title">
           
            <span class="require-field">*</span></td>
          </tr>
		  
		   <tr>
            <td class="label">文章副标题：</td>
            <td><input type="text" size="30" style="float:left;width:350px;;" value="<{$article_info.ar_subtitle|escape}>" name="ar_subtitle" id="ar_subtitle">
           
            </td>
          </tr>
		  
		   <tr>
            <td class="label">文章图片：</td>
            <td><input type="text" size="30" style="float:left; width:350px;" value="<{$article_info.ar_image|escape}>" name="ar_image" id="ar_image">
           
            </td>
          </tr>

		 
		  <tr>
            <td class="label">主分类：</td>
            <td>
		
			<select name="parent_id" id="parent_id" onchange="get_article(<{$w_type}>);">
		  
             <{$cat_select}>
			 </select>
            </td>
          </tr>
		  
          <tr>
            <td class="label">扩展分类：</td>
            <td id="addOther_type">
			
			 
              <a id="A5" href="javascript:void(0);">选择扩展分类</a>&nbsp;&nbsp;
			 
			 <input type="text" size="30" style="color:;" value="<{$article_info.ar_vicecat_id }>" name="other_cat"  id="other_cat" disabled="disabled"> 
			
			 <input type="hidden" name="other_cat_id" value="<{$article_info.ar_vicecat_id}>" id="other_cat_id" />
            </td>
          </tr>
		  
		   <tr>
            <td class="label">标签：</td>
            <td>
              <a id="A4" href="javascript:void(0);">选择</a>&nbsp;&nbsp;
			  <input type="text" size="30" style="color:;" value="<{$article_info.ar_tag_id}>" name="ar_tag"  id="ar_tag" disabled="disabled"> <input type="hidden" name="ar_tag_id" value="<{$article_info.ar_tag_id}>" id="ar_tag_id" />
            </td>
          </tr>
		  <tr>
		  
		  <tr>
            <td class="label">相关联文章：</td>
            <td>
              <a id="A6" href="javascript:void(0);">选择</a>&nbsp;&nbsp;
			  <input type="text" size="30" style="color:;" value="<{$article_info.related_article}>" name="related_article"  id="related_article" disabled="disabled"> <input type="hidden" name="hi_related_article" value="<{$article_info.related_article}>" id="hi_related_article" />
            </td>
          </tr>

<tr>
            <td class="label">相关联产品：</td>
            <td>
              <a id="A7" href="javascript:void(0);">选择</a>&nbsp;&nbsp;
			  <input type="text" size="30" style="color:;" value="<{$article_info.product_related}>" name="product_related"  id="product_related" disabled="disabled"> <input type="hidden" name="hi_product_related" value="<{$article_info.product_related}>" id="hi_product_related" />
            </td>
          </tr>
          <tr>
            <td class="label">底部关联产品：</td>
            <td>
			<select name="related_pro_bottom" id="related_pro_bottom">
			<option value="">选择产品</option>
            <{foreach from=$products item=v}><option value="<{$v.product_id}>" <{if $article_info.related_pro_bottom==$v.product_id}>selected="selected"<{/if}>><{$v.product_name}></option><{/foreach}>
	        </select>
            </td>
          </tr>
		  		  
		   <tr>
            <td class="label">推荐：</td>
            <td>
			<select name="is_recommend" id="is_recommend">
	<option value="1"  <{if $article_info.is_recommend == 1}> selected="selected"  <{/if}> >推荐</option>
	<option value="0" <{if $article_info.is_recommend == 0}> selected="selected" <{/if}> > 未推荐</option></select>
            </td>
          </tr>

		  <tr>
            <td class="label">热门：</td>
            <td>
			<select name="is_hot"  id="is_hot">
	<option value="1"  <{if $article_info.is_hot == 1}> selected="selected"  <{/if}> >热门文章</option>
	<option value="0" <{if $article_info.is_hot == 0}> selected="selected"  <{/if}> >一般文章</option></select>
            </td>
          </tr>
		  
		   <tr>
            <td class="label">点击数量：</td>
            <td>
              
			  <input type="text" size="20" <{if $article_info.click_count}> value="<{$article_info.click_count}>" 
			  <{else}> value="0" <{/if}>  name="click_count"  id="click_count">
            </td>
          </tr>
		   <tr>
            <td class="label">作者：</td>
            <td>
            <select id="author_id" name="author_id">
            <option value="0">请选择作者</option>
            <{foreach from=$authors item=v}><option value="<{$v.aid}>" <{if $article_info.author_id==$v.aid}>selected="selected"<{/if}>><{$v.author}></option><{/foreach}>
            </select>
            </td>
          </tr>
        </tbody></table>

        <!-- 详细描述 -->
        <table width="90%" style="display:none" id="detail-table">
          <tbody>
		   <tr>
            <td>文章简介</td>
			<td>
			<textarea name="ar_introduction" size="50" onkeydown="textCounter(200)" onkeyup="textCounter(200)"
			style="width:850px; height:100px;" style=" height:" id="ar_introduction"> <{$article_info.ar_introduction|escape}></textarea>
			</td>
          </tr>
		  
		   <tr>
            <td>文章正文</td>
			<td>
			<textarea name="ar_content"  id="ar_content" >  <{$article_info.ar_content|escape}> </textarea>
			</td>
          </tr>	 		  
        </tbody></table>
		
        <div  style="margin-left:380px; margin-top:20px;">
		  <input type="hidden" id="type"  value="1" />
          <input type="hidden"  name="ar_id"  id="ar_id" value="<{$article_info.ar_id}>" />
		  <input type="hidden"  name="image_file" id="image_file" value="<{$article_info.ar_image}>" />
          <input type="button"   class="button" value="<{$tile}> " name="sub_from" id='sub_from' onclick="check_submit(<{if $article_info.ar_id >0 }><{$article_info.ar_id}><{else}>0<{/if}>,<{$w_type}>,0);" />
          <input type="reset" class="button" value=" 重置 " />
        </div>
        <input type="hidden" value="<{$form_act}>" name="act" id="act" />
        <input type="hidden" value="<{$w_type}>" name="w_type" />
      </form>
    </div>

<div class="A4Demo" style="display: none; width: 650px; padding: 10px;">

<div id="A4Demo" >
       <div id="get_tag" style="overflow-y: auto; height:230px;"><{$all_tag}></div><br />
	   <input type="button"    value="确定" name="check_tag"  onclick="select_checked('tag','ar_tag','ar_tag_id','A4Demo');" style="margin-top:20px; margin-left:200px;">
	   
    </div>

</div>




<div class="A5Demo" style="display: none; width: 550px; padding: 10px;">

<div id="A5Demo" >
       <div id="get_cat" style="overflow-y: auto; height:100px;"><{$ar_cat_type}></div><br />
	   
	   <input type="button" value="确定" name="check_cat"  onclick="select_checked('cat-type','other_cat','other_cat_id','A5Demo');" style="margin-top:20px; margin-left:200px;">
	   
    </div>
	
</div>

<div class="A6Demo" style="display:none;height:380px;width:1000px;padding:10px;">
<div id="A6Demo" >
   <!--<div id="get_article" style="overflow-y:auto; height:200px;"><{$related_select}></div><br />-->
   <!--<input type="button" value="确定" name="check_related" onclick="select_checked('article','related_article','hi_related_article','A6Demo');" style="margin-top:6px;">-->
   <iframe id="ra_ifra" frameborder="0" width="100%" height="360" style="border:1px solid #BBDDE5"></iframe>
   <span id="relatedSelected">当前选择：</span>
   <input type="button" value="确定" name="check_related" onclick="_selectRelatedArticle();" style="margin-top:6px;" />
</div>
</div>

<div class="A7Demo" style="display:none;height:380px;width:1000px;padding:10px;">
<div id="A7Demo" >
   <!--<div id="get_article" style="overflow-y:auto; height:200px;"><{$related_select}></div><br />-->
   <!--<input type="button" value="确定" name="check_related" onclick="select_checked('article','related_article','hi_related_article','A6Demo');" style="margin-top:6px;">-->
   <iframe id="ra_ifra_p" frameborder="0" width="100%" height="360" style="border:1px solid #BBDDE5"></iframe>
   <span id="relatedSelected1">当前选择：</span>
   <input type="button" value="确定" name="check_related1" onclick="_selectRelatedProduct();" style="margin-top:6px;" />
</div>
</div>

<script type="text/javascript">// <![CDATA[
function  no_checked_parent()
{
 $('input[name="cat-type[]"]').each(function() { 
    if($('#parent_id').val() == $(this).val())
	{
	 $(this).attr("checked", ''); 
	}
	 $(this).attr("disabled", ""); 

  }); 
  $('input[name="cat-type[]"]').each(function() { 
    if($('#parent_id').val() == $(this).val())
	{
	 $(this).attr("disabled", 'disabled'); 
	 }
  }); 
}

$("#A4").click(function() {
 $("#A4Demo").show();
 
 $(".A4Demo").cvbox({
   titleBarText: "选择标签"
 });
   $("#parent_id").hide();
   $("#is_recommend").hide();
   $("#is_hot").hide();
   $("#cvBoxTitleBarClose").click( function () 
   {$("#parent_id").show();
   $("#is_recommend").show();
   $("#is_hot").show();
   }); 
});
	
$("#A5").click(function() {
 $("#A5Demo").show();
 $(".A5Demo").cvbox({
  titleBarText: "选择扩展分类"
  });
  $("#parent_id").hide();
  $("#is_recommend").hide();
  $("#is_hot").hide();
  $("#cvBoxTitleBarClose").click( function () 
   {
   $("#parent_id").show();
   $("#is_recommend").show();
   $("#is_hot").show();
  });
  
});

$("#A6").click(function() {
 $("#A6Demo").show();
 $(".A6Demo").cvbox({
  titleBarText: "选择相关联文章"
  });
   $("#parent_id").hide();
   $("#is_recommend").hide();
   $("#is_hot").hide();
   $("#cvBoxTitleBarClose").click( function (){
		$("#parent_id").show();
		$("#is_recommend").show();
   		$("#is_hot").show();
   });
   
   var ids = $("#related_article").val();
   $("#ra_ifra").attr('src','?action=index&w_type=<{$w_type}>&forselect=1&selected='+ids +'&limit=10&hide_ar_id=<{$article_info.ar_id}>');
	
	if( ids == '' ) return;
	var arr = ids.split(',');
	for(var id in arr){
		if( sb["sb_"+id] ) return;
		$("#relatedSelected").html($("#relatedSelected").html()+'<label id="art_'+arr[id]+'"><input type="checkbox" checked="checked" value="'+arr[id]+'" />'+arr[id]+'&nbsp;</label>');
		sb["sb_"+id] = id; 
	}
	
	checkboxFun();
});

//note 选择相关文章,由iframe中调用
var sb = [];
function selectRelatedArticle( id, t ){
	
	if( t ){
		
		var len = $("#relatedSelected input[type='checkbox']").length;
		if( len >= 3 ){
			alert('文章的相关联文章不能超过3篇！');
			return false;	
		}
		
		if( sb["sb_"+id] ) return;
		$("#relatedSelected").html($("#relatedSelected").html()+'<label id="art_'+id+'"><input type="checkbox" checked="checked" value="'+id+'" />'+id+'&nbsp;</label>');
		sb["sb_"+id] = id;
	}else{
		$("#art_"+id).remove();
		sb["sb_"+id] = 0;
	}
	
	checkboxFun();
	
	return true;
}
//note 确定
function _selectRelatedArticle(){
	var str = c = '';
	$("#relatedSelected input[type='checkbox']:checked").each(function(){
		str += c + $(this).val();
		c = ',';
	});
	$("#related_article").val(str);
	$("#hi_related_article").val(str);
	$("#cvBoxTitleBarClose").click();
	sb = [];
	$("#relatedSelected").html( '当前选择：' );
}

function checkboxFun(){
	$("#relatedSelected input[type='checkbox']").each(function(){
		$(this).click(function(){
			if( !$(this).attr('checked') ){
				$(this).parent().remove();
			}	
		})	
	})	
}
function checkboxFun1(){
	$("#relatedSelected1 input[type='checkbox']").each(function(){
		$(this).click(function(){
			if( !$(this).attr('checked') ){
				$(this).parent().remove();
			}	
		})	
	})	
}
no_checked_parent();
$('#parent_id').click(function() {
	   no_checked_parent();
});

$("#A7").click(function() {
 $("#A7Demo").show();
 $(".A7Demo").cvbox({
  titleBarText: "选择相关联文章"
  });
   $("#parent_id").hide();
   $("#is_recommend").hide();
   $("#is_hot").hide();
   $("#cvBoxTitleBarClose").click( function (){
		$("#parent_id").show();
		$("#is_recommend").show();
   		$("#is_hot").show();
   });
   
   var ids = $("#product_related").val();
   $("#ra_ifra_p").attr('src','products.php?action=index&web_type=<{$w_type}>&forselect=1&selected='+ids +'&limit=10&hide_ar_id=<{$article_info.ar_id}>');
	
	if( ids == '' ) return;
	var arr = ids.split(',');
	for(var id in arr){
		if( sp["sp_"+id] ) return;
		$("#relatedSelected1").html($("#relatedSelected1").html()+'<label id="art_'+arr[id]+'"><input type="checkbox" checked="checked" value="'+arr[id]+'" />'+arr[id]+'&nbsp;</label>');
		sp["sp_"+id] = id; 
	}
	
	checkboxFun1();
});	
//note 选择相关文章,由iframe中调用
var sp = [];
function selectRelatedProduct( id, t ){
	
	if( t ){
		
		var len = $("#relatedSelected1 input[type='checkbox']").length;
		if( len >= 3 ){
			alert('文章的相关联文章不能超过3篇！');
			return false;	
		}
		
		if( sp["sp_"+id] ) return;
		$("#relatedSelected1").html($("#relatedSelected1").html()+'<label id="art_'+id+'"><input type="checkbox" checked="checked" value="'+id+'" />'+id+'&nbsp;</label>');
		sp["sp_"+id] = id;
	}else{
		$("#art_"+id).remove();
		sp["sp_"+id] = 0;
	}
	
	checkboxFun1();
	
	return true;
}
//note 确定
function _selectRelatedProduct(){
	var str = c = '';
	$("#relatedSelected1 input[type='checkbox']:checked").each(function(){
		str += c + $(this).val();
		c = ',';
	});
	$("#product_related").val(str);
	$("#hi_product_related").val(str);
	$("#cvBoxTitleBarClose").click();
	sp = [];
	$("#relatedSelected1").html( '当前选择：' );
}
no_checked_parent();
$('#parent_id').click(function() {
	   no_checked_parent();
});
</script>
</body>
</html>